package com.pfizer.Entity;

import java.util.Date;

/**
 * Survey--<b>問卷信息實體</b>--靜態變量為創建數據庫表需要的字段名
 * 
 * @author krui
 * @version 1.40 2011/11/19
 */
 
public class Survey{
	
	public static final String 	SURVEYSTRING="Survey";
	public static final String 	SURVEYIDSTRING="Survey_ID";
	public static final String 	SURVEYSUBJSTRING="Subject";
	public static final String	SURVEYBGTIMESTRING="Bg_Time";
	public static final String 	SURVEYEDTIMESTRING="Ed_Time";
	public static final String 	SURVEYREMARKSTRING="Remark";
	public static final String	SURVEYCLASSSTRING="SurveyClass";
	public static final String 	SURVEYQNSTRING="Questionnaire";
	public static final String	SURVEYLUTIMESTRING="Last_Upd_Time";
	
	
	private long 			Survey_ID=0;
	private String 	Survey_Subject="";
	private long		Bg_Time;
	private long	 	Ed_Time;
	private String		Remark;
	private String		SurveyClass;
	private long 		Questionnaire;
	private long		Last_Upd_Time;
	private Date		dt;
	public Survey(long _ID,String _Subj,String _Type,String _BgTime,String _EdTime,String  _Class,long _Questionnaire,String _LstTime)
	{
		this.Survey_ID=_ID;
		this.Survey_Subject=_Subj;
		dt=new Date(_BgTime);
		this.Bg_Time=dt.getTime();
		dt=new Date(_EdTime);
		this.Ed_Time=dt.getTime();
		this.SurveyClass=_Class;
		this.Questionnaire=_Questionnaire;
		dt=new Date(_LstTime);
		this.Last_Upd_Time=dt.getTime()/1000;
	}
	public Survey()
	{
		
	}
	public Survey(String _ID)
	{
		this.Survey_ID=new Long(_ID).intValue();
	}
	public void setID(String _ID)
	{
		this.Survey_ID=new Long(_ID).intValue();
	}
	public void setID(long _ID)
	{
		this.Survey_ID=_ID;
	}
	public long getID()
	{
		return this.Survey_ID;
	}
	public void setSubject(String _Subj)
	{
		this.Survey_Subject=_Subj;
	}
	public String getSubject()
	{
		return this.Survey_Subject;
	}
	public void setBgTime(String _BgTime)
	{
		dt=new Date(_BgTime);
		this.Bg_Time=dt.getTime()/1000;
	}
	public void setBgTime(long _BgTime)
	{
		this.Bg_Time=_BgTime;
	}
	public long getBgTime()
	{
		return this.Bg_Time;
	}
	public void setEdTime(String _EdTime)
	{
		dt=new Date(_EdTime);
		this.Ed_Time=dt.getTime()/1000;
	}
	public void setEdTime(long _EdTime)
	{
		this.Ed_Time=_EdTime;
	}
	public long getEdTime()
	{
		return this.Ed_Time;
	}
	public void setRemark(String  _Remark)
	{
		this.Remark=_Remark;
	}
	public String getRemark()
	{
		return this.Remark;
	}
	public void setSurveyClass(String  _Class)
	{
		this.SurveyClass=_Class;
	}
	public String getSurveyClass()
	{
		return this.SurveyClass;
	}
	public void setQuestionnaire(String _Questionnaire)
	{
		this.Questionnaire=new Long(_Questionnaire).intValue();
	}
	public void setQuestionnaire(long _Questionnaire)
	{
		this.Questionnaire=_Questionnaire;
	}
	public long getQuestionnaire()
	{
		return this.Questionnaire;
	}
	public void setLstUpdTime(String _LstUpdTime)
	{
		dt=new Date(_LstUpdTime);
		this.Last_Upd_Time=dt.getTime()/1000;
	}
	public void setLstUpdTime(long _LstUpdTime)
	{
		this.Last_Upd_Time=_LstUpdTime;
	}
	public long getLstUpdTime()
	{
		return this.Last_Upd_Time;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return String.valueOf(this.Survey_ID)+",name  "+this.Survey_Subject+"  Desc  "+this.Remark+"\n";
	}
}
